#ifndef MULTI_EPOLLSERVER_INCLUDED
#define MULTI_EPOLLSERVER_INCLUDED

#include "epollclientsocket.h"
#include "socketaddress.h"

class MultiEpollServer
{
public:
    MultiEpollServer(const SocketAddress& addr,
            EpollClientFactory* pf,
            unsigned int epollnum = 2,
            unsigned int pooledthreadnum = 8)
        : m_serveraddr(addr)
          ,m_epollnum(epollnum)
          ,m_pooledthreadnum(pooledthreadnum)
          ,m_factory(pf)
          ,m_exit(false)
    {}

    void wait(unsigned int fdTimeoutSeconds = 0);
    void stop()
    {
        m_exit = true;
    }
private:
    SocketAddress       m_serveraddr;
    unsigned int        m_epollnum;
    unsigned int        m_pooledthreadnum;
    EpollClientFactory  *m_factory;
    bool                m_exit;
};


#endif




